package dao;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;

import javax.imageio.ImageIO;

public class SaveContent {
	public String titleName =null;
	public BufferedImage img= null;
	public String imageUrl= null;
	public String overView= null;
	public ArrayList<String> lables;
	private String createdTime= null;
	
	
	public SaveContent(String _titleName,String _overView,String _imageUrl,String[]labels){
		titleName= _titleName;
		overView=_overView;
		imageUrl= _imageUrl;
		lables= new ArrayList<String>(Arrays.asList(labels));
		setDateTime();
		try {
			img=  ImageIO.read( new File(imageUrl) );
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public SaveContent(String _imageUrl){
		imageUrl= _imageUrl;
		lables= new ArrayList<String>();
		setDateTime();
		try {
			img=  ImageIO.read( new File(imageUrl) );
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public SaveContent(){
		lables= new ArrayList<String>();
		setDateTime();
	}
	private void setDateTime(){
		Date now = new Date(); 
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
		createdTime= dateFormat.format(now);
	}
}
